package com.factory.service.impl;

import java.util.Date;
import java.util.List;

import com.factory.domain.SocketData;
import com.factory.mapper.SocketDataMapper;
import com.factory.service.ISocketDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.xml.crypto.Data;

/**
 * Socket原数据Service业务层处理
 *
 * @author ruoyi
 * @date 2024-04-11
 */
@Service
public class SocketDataServiceImpl implements ISocketDataService {
    @Autowired
    private SocketDataMapper socketDataMapper;

    /**
     * 查询Socket原数据
     *
     * @param id Socket原数据主键
     * @return Socket原数据
     */
    @Override
    public SocketData selectSocketDataById(Long id) {
        return socketDataMapper.selectSocketDataById(id);
    }

    @Override
    public List<SocketData> selectSocketDataList(Long systemId) {
        return socketDataMapper.selectSocketDataList(systemId);
    }

    /**
     * 查找最新的一条数据
     */
    public SocketData selectSocketLatestData(SocketData socketData) {
        return socketDataMapper.selectSocketLatestData(socketData);
    }

    /**
     * 新增Socket原数据
     *
     * @param socketData Socket原数据
     * @return 结果
     */
    @Override
    public int insertSocketData(SocketData socketData) {
        return socketDataMapper.insertSocketData(socketData);
    }

    //根据时间查询曲线图数据
    @Override
    public List<SocketData> socketParameterCurve(Long systemId, String createTime, String endTime) {

        return socketDataMapper.socketParameterCurve(systemId,createTime, endTime);
    }

    @Override
    public List<SocketData> socketListPage(Long systemId,Long startPage, Long endPage) {
        return socketDataMapper.socketListPage(systemId,startPage, endPage );
    }
}
